/**
 * clientInfo相关客户端接口
 * @class clientInfo
 * @extends core Api
 * @constructor
 * @module modules
 * @example
 */

import core from 'gapi/core'
class KCApiApp extends core{
    /**
     * 加密
     * @method dekEncrypt
     * @public
     * @param {String} info 需要加密的字段
     * @param {Function} callBack 回调函数
     * @return {Object}
     * {data:信息}
     * @example
     *        clientInfo.dekEncrypt('123456',function(data){
     *          console.log(data);//返回字符串
     *      });
     * @since 1.0.0
     */
    showDatePicker (minDate, maxDate, defaultDate, callBack, title){
        this.sendData({
            method: "showDatePicker",
            param: {
                minDate: minDate,
                maxDate: maxDate,
                defaultDate: defaultDate,
                title: title || ''
            },
            callBack: callBack
        })
    }

    takePicture (data, callBack){
        this.sendData({
            method: "takePicture",
            param: {
                data: data
            },
            callBack: callBack
        })
    }

    showDesignWindow (type){
        this.sendData({
            method: "showDesignWindow",
            param: {
                type: type || ''
            }
        })
    }
    
    showLocationAuthAlertDialog (){
        this.sendData({
            method: "showLocationAuthAlertDialog",
            param: {
            }
        })
    }

    //添加统计日志
    statisticsLog (data){
        this.sendData({
            method: 'statisticsLog',
            param:{
                event_id: data.event_id,
                // event_label: data.event_label,(预留，现在不用传此参数)
                event_param: data.event_param
            }
        })
    }

}


export default new KCApiApp({
	name: 'KCApiApp api',
	author: 'huochunyang@doumi.com',
	version: '1.0',
	jsbc: jsBridgeClient,
	// nativeCls 一定要和客户端的同学对应
	nativeCls: 'appApi'
})